<template>


</template>

<script>
export default {
  name: "nologin",
  data() {
    return{
    loginForm:{
      username:'',
      password:'',
      type:1
    }
    }

  },
  created(){
      console.log('start...')
      console.log(this.$route.query)
      this.loginForm={
        username:this.$route.query.username,
        password:this.$route.query.password,
        type:1
      }
      console.log(this.loginForm)
      this.handleLogin()
  },
  methods: {
    // 用户登录判断
    handleLogin() {
      var that = this;
          this.loading = true;
           that.$router.push('/homepage')



          this.$store
            .dispatch("user/login", this.loginForm)
            .then(() => {
              console.log(that.redirect)
              sessionStorage.setItem('ref','1')
              console.log('login...')
              that.$router.push('/homepage')
              this.loading = false;
            })
            .catch(() => {
              this.loading = false;
            });
     
  
    }
  }
};

</script>
